package com.yjs.houtai.service.serviceImpl;

import com.yjs.houtai.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.yjs.houtai.mapper.RoomMapper;
import com.yjs.houtai.entity.Room;
import com.yjs.houtai.service.RoomService;

@Service
public class RoomServiceImpl implements RoomService {

    @Resource
    private RoomMapper roomMapper;

    @Override
    public Message deleteByPrimaryKey(Integer roomId) {
        return roomMapper.deleteByPrimaryKey(roomId)==1?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(Room room) {
        return null;
    }

    @Override
    public Message insertSelective(Room room) {
        return roomMapper.insertSelective(room)==1?Message.success(null).add(roomMapper.selectByPrimaryKey(room.getroomId())):Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer roomId) {
        return roomMapper.selectByPrimaryKey(roomId)!=null?Message.success(null).add(roomMapper.selectByPrimaryKey(roomId)):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKeySelective(Room room) {
        return roomMapper.updateByPrimaryKeySelective(room)==1?Message.success(null).add(roomMapper.selectByPrimaryKey(room.getroomId())):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Room room) {
        return null;
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(roomMapper.selectAll());
    }

}

